package lab02.Test06;

import java.util.Scanner;

/**
 * Created by 星月 on 2017/10/15.
 */
public class Ladder{
    //属性：上底、下底、高、面积
    double top;
    double bottom;
    double height;
    double area;
    //行为：返回面积
    public double getArea() {
        double area=((top+bottom)*height)/2;
        System.out.println("梯形的面积为："+area);
        return area;
    }
    //构造函数
    //main函数
    public static void main(String[] args) {
        Scanner i=new Scanner(System.in);
        double top=i.nextDouble();
        double bottom=i.nextDouble();
        double height=i.nextDouble();
        Ladder n=null;
        n=new Ladder();
        n.top=top;
        n.bottom=bottom;
        n.height=height;
        n.getArea();

    }
}
